package com.Day1009;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;

public class Text5 {
    public static void main(String[] args) throws Exception {
        String readerFilePath = "D:\\IDEA\\dddd\\src\\com\\lzy\\day01\\Text.java";
        String writerFilePath = "D:\\IDEA\\dddd\\src\\com\\lzy\\day01\\c.java";
        File fileReader = new File(readerFilePath);
        //   input 输入   stream  字节
        FileInputStream fileInputStream = new FileInputStream(fileReader);
        FileOutputStream fileOutputStream = new FileOutputStream(writerFilePath);
        byte[] temp = new byte[1024];
        StringBuffer stringBuffer = new StringBuffer();
        while (fileInputStream.read(temp) != -1){
            String str = new String(temp);
            fileOutputStream.write(temp);
            stringBuffer.append(str);
        }
        //fileOutputStream.write(stringBuffer.toString().getBytes());
        System.out.println(stringBuffer.toString());
        fileInputStream.close();
    }
}
